public class demo {
    public static void main(String[] args) {
        a instance1 = a.getInstance();
        a instance2 = a.getInstance();
        System.out.println(instance1.equals(instance2));
    }
}
class a {
    private static a a = null;
    private a(){
    }
    public static a getInstance() {
        if ( a == null ){
            a =new a();
        }
        return a;
    }
}